cmake_minimum_required(VERSION 3.14)
project(G4Beginner)
find_package(Geant4 REQUIRED ui_all vis_all)##加上可视化
include(${Geant4_USE_FILE})
include_directories(${PROJECT_SOURCE_DIR}/include)
file(GLOB source ${PROJECT_SOURCE_DIR}/src/*.cpp)
file(GLOB header ${PROJECT_SOURCE_DIR}/include/*.h)
add_executable(G4Beginner begin_simulation.cpp ${source} ${header})
target_link_libraries(G4Beginner ${Geant4_LIBRARIES})
message("hello geant4")
message("llll")
##复制脚本并添加可视化
set(G4Beginner_SCRIPTS
auto.mac
vis_2.mac
vis.mac)
foreach(_scipt ${G4Beginner_SCRIPTS})
configure_file(
${PROJECT_SOURCE_DIR}/${_scipt}
${PROJECT_BINARY_DIR}/${_scipt}
COPYONLY
)
    
endforeach()

